﻿using System;
using System.Windows;
using System.Collections.Generic;
using System.Text;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Windows.Controls;
using System.Windows.Media.Animation;


namespace mates_viz
{
    public class UIUser
    {
        public delegate void UserUIEvent(UIUser user, System.Windows.Input.MouseEventArgs mouseArgs);
        public event UserUIEvent UserMouseEnter;

        public Canvas userCanvas;       // the user's graphical representation
        public Ellipse userEllipse;     // the user's graphical representation
        public Button userButton;

        public Label userLabel;         // graphical representation of user name
        public int tickIndex;           // where the user is positioned within the arc
        public RotateTransform myRT;
		public RotateTransform myInPlaceRT;	// spins the user to maintain upright

        private string username; public string Username { get { return username; } }
        // generate an event when the tick number changes!

        public UIUser(string Username)
        {

            username = Username;

            userButton = new Button();
            userButton.Style = (Style)userButton.FindResource("userButton");
           
            userButton.Foreground = Brushes.White;
            userButton.Height = 30;
            userButton.Width = 100;
            //userButton.FontWeight = FontWeight.Bold;
            userButton.FontFamily = "Arial";
            userButton.Content = username;

            //userCanvas = new Canvas();
            //userCanvas.Height = 10;
            //userCanvas.Width = 10;

            //userCanvas.Background = Brushes.White;

            //userLabel = new Label();
            //userLabel.FontSize = new FontSize(12);
            //userLabel.Foreground = Brushes.White;
            //userLabel.FontFamily = "Arial";
            //userLabel.FontWeight = FontWeight.Bold;
            //userLabel.HorizontalContentAlignment = HorizontalAlignment.Center;

            //userLabel.Content = username;
            //userLabel.Width = 100;
            //Canvas.SetLeft(userLabel, -50);
            //Canvas.SetTop(userLabel, -10);

            //userEllipse = new Ellipse();
            //userEllipse.RadiusX = 10;
            //userEllipse.RadiusY = 10;
            //userEllipse.CenterX = 0;
            //userEllipse.CenterY = 5;
            //userEllipse.Fill = Brushes.White;
            //userEllipse.Opacity = 0.6;

            userButton.MouseEnter += new System.Windows.Input.MouseEventHandler(userButton_MouseEnter);

            //userCanvas.Children.Add(userLabel);
            //userCanvas.Children.Add(userEllipse);

        }

        void userButton_MouseEnter(object sender, System.Windows.Input.MouseEventArgs args)
        {
            UserMouseEnter(this, args);   // fire the mouse enter event.
        }

    }
}
